package com.zzyl.mapper;

import com.zzyl.entity.RoleResource;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleResourceMapper {

    int deleteByPrimaryKey(Long id);

    int insert(RoleResource record);

    int insertSelective(RoleResource record);

    RoleResource selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(RoleResource record);

    int updateByPrimaryKey(RoleResource record);

    int batchInsert(@Param("list") List<RoleResource> list);

    //查询菜单是否绑定用户
    Long selectRoleByResource(String resourceNo);

    //根据角色ID查询资源数据
    List<String> selectResourceIdByRoleId(Long roleId);

    @Delete("delete from sys_role_resource where role_id=#{id};")
    void delectAllForUpdate(Long id);

    //新增

}